<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>登陆页面</title>
 		<link rel="stylesheet" type="text/css" href='${pageContext.request.contextPath}/css/styles.css'> 
		<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
   		<script src="${pageContext.request.contextPath}/js/jquery-1.9.1.min.js"></script>
  		<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
	</head>
	<body><!--  
		<s:include value="/WEB-INF/jsp/head/header.jsp" />-->
		<s:if test="#session['user'] != null">
			<input type="hidden" id="curr_user" value="<s:property value="#session['user'].nickName" />">
			<div class="navbar navbar-default" role="navigation">
   				<div class="navbar-header">
      				<s:a cssClass="navbar-brand" action="LoginAction_exit">退出系统</s:a>
   				</div>
   				<div>
      				<p class="navbar-text navbar-right">Signed in as 
         				<s:property value="#session['user'].nickName" />
      				</p>
      				
  				</div>
			</div>
			
			<div class="divWhiteLine"></div>
		</s:if>
		<s:elseif test="#session['user'] == null">
			<input type="hidden" id="curr_user" value="0"/>
		</s:elseif>
		<s:form action="LoginAction_doLogin" namespace="/" method="post" target="_top">
		<table>
			<tr>
				<td colspan="2" class="tdWhiteLine"></td>
			</tr>
			<tr>
				<td class="tdHeader" colspan="2">用户登陆</td>
			</tr>
			<tr>
				<td colspan="2" class="tdWhiteLine"></td>
			</tr>
			<tr>
				<td class="tdFormLabel" width="40%">E-mail:</td>
				<td class="tdFormControl">
					<input type="text" name="email" class="text" value="admin@163.com">
					<font class="fonterror"><br><s:actionerror></s:actionerror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">密码:</td>
				<td class="tdFormControl">
					<input type="password" name="password" class="text" value="admin">
					<font class="fonterror"></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel"></td>
				<td class="tdFormControl"><s:submit id="submit" type="submit" cssClass="btn btn-primary" value="登录"/></td>
			</tr>
		</table>
		</s:form>
	<script>
		$(function(){
			var p = $("#curr_user").val();
			if(p != 0){
				$("#submit").addClass("disabled");
			}else if(p == 0){
				$("#submit").removeClass("disabled");
			}
		});
	</script>
	</body>
</html>
